﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MyMovieInfo.GoodExample
{
    // interface segregation principle - good example
    interface IWorker : IFeedable, IWorkable
    {
    }

    interface IWorkable
    {
        void work();
    }

    interface IFeedable
    {
        void eat();
    }

    class Worker : IWorkable, IFeedable
    {
        public void work()
        {
            // ....working
        }

        public void eat()
        {
            //.... eating in launch break
        }
    }

    class Robot : IWorkable
    {
        public void work()
        {
            // ....working
        }
    }

    class SuperWorker : IWorkable, IFeedable
    {
        public void work()
        {
            //.... working much more
        }

        public void eat()
        {
            //.... eating in launch break
        }
    }

    class Manager
    {
        IWorkable _worker;

        public void setWorker(IWorkable w)
        {
            _worker = w;
        }

        public void manage()
        {
            _worker.work();
        }
    }
}
